package ar.edu.utn.frsf.tpae.a2012.g05.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import ar.edu.utn.frsf.tpae.a2012.g05.dao.ClienteDao;
import ar.edu.utn.frsf.tpae.a2012.g05.entity.Cliente;
import ar.edu.utn.frsf.tpae.a2012.g05.service.ClienteService;

@Service
public class ClienteServiceImpl implements ClienteService {

	@Autowired @Qualifier("clienteDaoImpl")
	private ClienteDao clienteDao;

	public Cliente login(String nroCliente, String password) {
		Cliente cliente = clienteDao.findByNumber(nroCliente);
		
		if (cliente != null && cliente.getDocumento().equals(password)) {
			return cliente;
		}
		return null;
	}
	
	public void setClienteDao(ClienteDao clienteDao) {
		this.clienteDao = clienteDao;
	}
	
	
}
